// InputSystem.h: interface for the InputSystem class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_INPUTSYSTEM_H__01C406A7_28EA_4CEA_9272_25F975EBC039__INCLUDED_)
#define AFX_INPUTSYSTEM_H__01C406A7_28EA_4CEA_9272_25F975EBC039__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "LSHCommon.h"

LSH_NAMESPACE_BEGIN

class System;

typedef enum {
	KEYCODE_NONE,
	KEYCODE_ENTER,
	KEYCODE_ESCAPE,
	KEYCODE_UP,
	KEYCODE_DOWN,
	KEYCODE_LEFT,
	KEYCODE_RIGHT,
	KEYCODE_COUNT
}eKeyboardCode;

struct KeyEvent {
public:
    typedef enum {
        KEY_EVENT_NONE,
        KEY_EVENT_KEY_DOWN,
        KEY_EVENT_KEY_UP,
    }eKeyEventType;
public:
	eKeyEventType m_nType;	// EVENT_XXX, type of event
	long m_nKeyCode;		// key code
};

class InputSystem
{
public:
	InputSystem();
	virtual ~InputSystem();
public:
    virtual bool Init(System* pSystem) = 0;
    virtual void Shutdown() = 0;
public:
    virtual void PostKeydown() = 0;
    virtual void PostKeyUp() = 0;
public:
    virtual int KeyState( int nKeyCode ) = 0;
	virtual bool IsKeyPending() = 0;
	virtual bool PeekKey( KeyEvent &KeyEvent ) = 0;
	virtual bool ReadKey( KeyEvent &KeyEvent ) = 0;
	virtual void ClearKeyQueue() = 0;
};

LSH_NAMESPACE_END

#endif // !defined(AFX_INPUTSYSTEM_H__01C406A7_28EA_4CEA_9272_25F975EBC039__INCLUDED_)
